package cn.itrip.auth;

import cn.itrip.mapper.HotelMapper;
import cn.itrip.beans.pojo.Hotel;
import com.github.pagehelper.PageHelper;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class TestPageHelperAndMapper {

    public static void main(String[] args) {

        HotelMapper htmp=new ClassPathXmlApplicationContext("spring.xml").getBean(HotelMapper.class);

       PageHelper.startPage(3,5,false);
       //Page<Hotel> page=  PageHelper.offsetPage(3,5,true);
      //  System.out.println(page);
       List<Hotel> list= htmp.selectAll();
        for (Hotel hotel:list ) {
            System.out.println(hotel.getHotelname());
        }



    }
}
